// 导入路由
// createWebHashHistory  Hash
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router';

import Home from '../views/Home.vue';
import Shop from '../views/Shop.vue';
import Cart from '../views/Cart.vue';
import NotFound from '../views/NotFound.vue';

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/home',
      name: 'home',
      component: Home,
    }, {
      path: '/cart',
      name: 'cart',
      component: Cart,
    }, {
      path: '/shop/:id',
      name: 'shop',
      component: Shop
    }, {
      path: '/:str(.*)',
      component: NotFound
    }
  ]
});

export default router;

